<template>
  <Progress />
  <FileList></FileList>
</template>

<script setup>
import { useI18nStore, useFileStore, useFlagStore } from '@/stores';

const fileStore = useFileStore();
const i18nStore = useI18nStore();
const flagStore = useFlagStore();

watchEffect(() => {
  if (fileStore.curFolderId === 0) {
    fileStore.setCurFolderInfo({
      folder_id: 0,
      name: i18nStore.translate('my_files')
    });
  }
});

async function fetchData() {
  flagStore.setFileListLoading(true);
  await fileStore.entryFolder(0);
  flagStore.setFileListLoading(false);
}
onMounted(() => {
  fileStore.setType(1);
  fetchData();
});
</script>

<style scoped lang="scss">
@import './index.scss';
</style>
